#include "stdafx.h"
#pragma once
//-------------------------------------------------------------------------------------------------
//ImageProp.h  - a property for a particular Image - abstract class
//	typically an Image has one or more properties that a user can edit in the Property Window (top part)           
//-------------------------------------------------------------------------------------------------
//FreeBSD License
//Copyright 2011 Will Stott All rights reserved.
//
//Redistribution and use in source and binary forms, with or without modification, are
//permitted provided that the following conditions are met:
//
//   1. Redistributions of source code must retain the above copyright notice, this list of
//      conditions and the following disclaimer.
//
//   2. Redistributions in binary form must reproduce the above copyright notice, this list
//      of conditions and the following disclaimer in the documentation and/or other materials
//      provided with the distribution.
//
//THIS SOFTWARE IS PROVIDED BY Will Stott ``AS IS'' AND ANY EXPRESS OR IMPLIED
//WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
//FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL Will Stott OR
//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
//CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
//SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
//ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
//ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
//The views and conclusions contained in the software and documentation are those of the
//authors and should not be interpreted as representing official policies, either expressed
//or implied, of Will Stott.
//
//----Authors--------------------------------------------------------------------------------------
//created by: will.stott@ucl.ac.uk Sept 2011
//
//----Comments-------------------------------------------------------------------------------------
//
//<Header>
//   <ImageTypes>Types of Images found in Static Image Review
//        <ImageType>Ovary TS</ImageType>
//				<ImageTypeProps>Properties for this type of image
//					<ImageTypeProp Type="ImagePropTextLines" Control="CEdit" ValMin="-1" ValMax="500" Prompt="Enter text to describe image">Notes</ImageTypeProp>
//					<ImageTypeProp Type="ImagePropInteger" Control="Spin" ValMin="1" ValMax="3" Prompt="Enter quality score image">Quality</ImageTypeProp>
//				</ImageTypeProps>
//				<ImageTypeImageObjects>Types of Objects found in this type of image
//					<ImageTypeImageObject Base="PtShape" PtCode="INC" PenColour="0:0:0" ExpertMaxObjs="-1" MenuName="Inc Cyst">Inclusion Cyst
//                    <ImageTypeProps>Properties of an Inclusion Cyst Image Object
//                        <ImageTypeProp Type="ImagePropTextLines" Control="CEdit" ValMin="-1" ValMax="500" Prompt="Enter text to describe Inclusion Cyst">Notes</ImageTypeProp>
//					      <ImageTypeProp Type="ImagePropInteger" Control="Spin" ValMin="1" ValMax="3" Prompt="Enter quality score for Inclusion Cyst">Quality</ImageTypeProp>
//					  </ImageTypeProps>
//					</ImageTypeImageObject>
//					... other ImageTypeImageObjects go here
//				<ImageTypeImageObjects>
//	 </ImageTypes>		
//   ...
//<Header>
//<Body>
//   <Images>
//		<Image ImageType="Ovary TS" Notes="this is a nice clear image" Quality="1" >1.2.826.999999.1.9999.1.20080115012154575.1.3.0 
//			<ImageObject Type="Inclusion Cyst" Note="this is a poor example" Quality="3" PtCnt="76" y1="176" x1="346" ... y76="176" x76="346">1316593822</ImageObject>
//			<ImageObject Type="Inclusion Cyst" Note="this is a better example" Quality="2" PtCnt="65" y1="21" x1="234"... y65="21" x65="234" >1316593823</ImageObject>
//		</Image>
//		...
//	 </Images>
//</Body>
//
//...........................................................................................................
//   Owner <ImageType>
//		<ImageTypeProp Type="ImagePropInteger" Control="Spin" ValMin="1" ValMax="3" Prompt="Enter quality score image">Quality</ImageTypeProp>
//   Owner <ImageTypeImageObject>
//		<ImageTypeProp Type="ImagePropTextLines" Control="CEdit" ValMin="-1" ValMax="500" Prompt="Enter text to describe Inclusion Cyst">Notes</ImageTypeProp>
//...........................................................................................................


//--------------------------------------------------------------------------------------------------

#ifdef IMAGEPROCLIB_EXPORTS
#define IMAGEPROCLIBAPI __declspec(dllexport)
#else
#define IMAGEPROCLIBAPI __declspec(dllimport)
#endif

#include "TinyXmlLib.h"

#include "ImageTypeProp.h"



class IMAGEPROCLIBAPI ImageProp
{
public:
	static const char * const xmlCtrlSpin;
	static const char * const xmlCtrlSLEdit;
	static const char * const xmlCtrlMLEdit;

private:
	ImageTypeProp *_pOwnerType;

public:
	ImageProp(void);
	virtual ~ImageProp(void);

	virtual const char *GetPropName() = 0;
	virtual bool SaveValueTo(TiXmlElement *xmlImageTypeProp) = 0;

	virtual void SetPropValue(const char * val) = 0;
	virtual const char *GetPropValue() = 0;

	static	ImageProp	  *CreateImageProp(const char *xmlPropName, const char *xmlValue, ImageTypeProp *pOwnerType);	
			ImageTypeProp *GetOwner () { return _pOwnerType; }

private:
	void	SetOwnerType (ImageTypeProp *pOwnerType) { _pOwnerType = pOwnerType; }
};

//-------------------------------------------------------------------------------------------------
//			E N D   O F   F I L E
//-------------------------------------------------------------------------------------------------

